function Get-CentralParameters {
    [CmdletBinding()]
    [OutputType('Parameters')]
    param (
        [Parameter(Mandatory = $false)][Parameters]$Parameters = (New-LSParameters)
    )

    # Get LS Central On-Premise or SaaS.
    $Parameters.LSCentral.Placement = Get-CentralPlacement -Placement $Parameters.LSCentral.Placement -ConfirmAll $Parameters.ConfirmAll
    
    # Get LS Central placement specific parameters.
    if ($Parameters.LSCentral.Placement -eq 'On_Premises') {
        Get-CentralOnPremParameters $Parameters
    } else {
        Get-CentralCloudParameters $Parameters
    }

    # Get companies
    $params = @{
        LSCentral = $Parameters.LSCentral
        ProjectFolder = $Parameters.LSInsight.ProjectFolder
        ConfirmAll = $Parameters.ConfirmAll
    }
    $Parameters.LSCentral.Companies = Get-CentralCompanies @params

    # Confirm parameters.
    $confirmed = Confirm-CentralParameters -LSCentral $Parameters.LSCentral

    if (!$confirmed) {
        return (Get-CentralParameters -Parameters $Parameters)
    }

    # Store 'Parameters' object in the project folder.
    if ($Parameters.LSInsight.ParametersOutFilePath) {
        Write-LSParameters -Parameters $Parameters -File $Parameters.LSInsight.ParametersOutFilePath
    }

    return $Parameters
}